Skip to content

feat(deploy): implement resumable deploy wizard#260

Draft
wyattjoh wants to merge 6 commits intomainfrom
wyattjoh/deploy
Draft

feat(deploy): implement resumable deploy wizard#260
wyattjoh wants to merge 6 commits intomainfrom
wyattjoh/deploy

Conversation

@wyattjoh
Copy link
Copy Markdown
Contributor

@wyattjoh wyattjoh commented May 6, 2026

Summary

This PR adds the first hidden clerk deploy implementation for guiding a linked Clerk app from development setup toward production. In human mode, the wizard validates clone compatibility, discovers enabled OAuth providers from the development instance config, asks for a user-owned production domain, creates a production instance, guides DNS setup, collects production OAuth credentials, and prints production next steps. In agent mode, the command still exits early with a structured deployment prompt for noninteractive use.

Details

  • Registers a hidden clerk deploy command with --debug, --continue, and --abort.
  • Adds deploy API-shaped mocks for the production-instance lifecycle: validate cloning, create production instance, deploy-status polling, SSL/mail retry hooks, and production config patching. These are intentionally isolated in commands/deploy/api.ts with FIXME(deploy) markers so each helper can be replaced by a live Platform API call later.
  • Persists paused deploy state in the CLI profile, including app and development instance identity, production instance/domain ids, the active DNS or OAuth step, all enabled OAuth providers, and completed provider progress.
  • Supports safe pause/resume behavior for DNS handoff, skipped OAuth setup, and prompt interruption. Plain clerk deploy refuses to start a second operation while a deploy bookmark exists, and --continue validates that the saved bookmark belongs to the currently linked project.
  • Adds OAuth credential flows for Google, GitHub, Microsoft, Apple, and Linear. Google can import a downloaded OAuth JSON file, Apple validates the selected .p8 private key file, and provider walkthroughs show the required production origins and redirect URLs.
  • Adds deploy-specific copy helpers for the plan summary, CNAME records, dashboard handoff, pause messaging, production summary, and post-deploy next steps.
  • Extends spinner/log gutter rendering with tone-aware rails for active, paused, cancelled, failed, and successful command states, plus more robust prompt-exit handling.
  • Replaces key-shaped mock deploy values with MOCKED_NOT_REAL_FIXME so the branch does not trip secret scanning.

Reviewer Notes

  • This command is hidden for now.
  • The deploy lifecycle API calls are mocked by design. The only live read in the wizard is development instance config discovery via existing PLAPI plumbing.
  • Production OAuth writes are also mocked while the production instance returned by the deploy flow is fake.
  • The deploy README was updated with the current mocked endpoint surface, sequence diagram, OAuth credential shapes, and resume/abort behavior.

Testing

  • bun run scripts/run-tests.ts --pattern 'packages/cli-core/src/commands/deploy/index.test.ts' --concurrency 1

wyattjoh added 2 commits May 5, 2026 18:14
- Preserve completed providers when pausing OAuth setup mid-loop, so
  `clerk deploy --continue` can finish multi-provider stacks.
- Surface a warning for OAuth providers enabled in dev that the wizard
  does not yet support, instead of silently skipping them.
- Close the gutter as Paused (not Failed) when DNS verification times
  out, since the state is recoverable via --continue.
- Tighten the production-domain regex to reject malformed inputs like
  example..com or example-.com before they reach the API.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: 6191e86

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

wyattjoh added 4 commits May 6, 2026 09:34
Move deploy lifecycle endpoint wrappers into the shared PLAPI client while routing the deploy wizard through a command-local adapter that defaults to mocked operations until the backend endpoints are ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant